package com.yizhang.controller;

import com.yizhang.domain.User;
import com.yizhang.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserMapper userMapper;


    @GetMapping("/login")
    public String loginPage() {
        return "login";
    }

    @GetMapping("/getUser")
    @ResponseBody
    public User getUser(@RequestParam("id") Integer id) {
        return userMapper.getUserById(id);
    }
}
